package com.he.DesignPatterns.Responsibility;

import jdk.nashorn.internal.ir.CallNode;

/**
 * @description: TODO
 * @Author: HCL
 * @Date: 2024/9/4 9:33
 */
public class Client {

    public static void main(String[] args) {
        //请假条
        LeaveRequest leaveRequest = LeaveRequest.builder()
                .name("小明")
//                .num(1)
//                .num(2)
                .num(8)
                .content("身体不适").build();

        //处理者对象
        GroupLeader groupLeader = new GroupLeader();
        Manager manager = new Manager();
        GeneralManager generalManager = new GeneralManager();

        //设置处理者链
        groupLeader.setHandler(manager);
        manager.setHandler(generalManager);

        //提交请假申请
        groupLeader.submit(leaveRequest);
    }
}
